<?php
	class BreadCrumb {	
		static function view(){
			$breadCrumb = '<div id="breadcrumb"><h2><a href="'.BASEURL.'">Bali Hotels & Bali Villas</a></h2> › ';
			
			if(!empty($_GET['hot'])){
				$hotel = Hotels::getHotelDetail($_GET['hot']);
				$breadCrumb .= '<a href="'.BASEURL.$hotel["slug"].'/">'.$hotel["destination_name"].'</a> › ';
				$breadCrumb .= '<span>'.$hotel["hotel_name"].'</span>';
			} else if(!empty($_GET['des'])){
				$slug = $_GET['des'];
				$sql = @mysql_query("SELECT * FROM destinations WHERE slug = '$slug'");
				$destination = @mysql_fetch_array($sql);
			
				$breadCrumb .= '<span>'.$destination["destination_name"].'</span>';
			} else if(!empty($_POST['global_search'])) {
				$breadCrumb .= '<span>Search Result</span>';
			}
			
			$breadCrumb .= '</div><div class="clearer"></div>';
			return $breadCrumb;
		}
	}
?>